﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinesys.Entities;

namespace Chinesys.Domain.InputValidations
{
    public class OrderInputValidation : InputValidationBase
    {
        private OrderEntity order;

        public OrderInputValidation(OrderEntity order)
        {
            this.order = order;
        }

        public override void Validate()
        {
            if (order.CustomerId < 1)
                Errors.Add(new Required("Customer Id"));

            if (order.DateBegin == DateTime.MaxValue || order.DateBegin == DateTime.MinValue)
                Errors.Add(new GeneralValidation("Error en Fecha de princio de orden"));            
        }
    }
}
